/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package BaseDeDatos;

import java.sql.*;
import javax.swing.*;

/**
 *
 * @author Freddy Aparicio, Ronald Melo
 */
public class ConexionBD {
    
    Connection conexion = null;

    //metodo o funcion de conexion
    public Connection conexion() {
        try {

            conexion = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/dbopac","root","System7144");
            JOptionPane.showMessageDialog(null, "Conexión exitosa con la base de datos OPAC");
           
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Error de Conexion con la base de datos OPAC\n" +"Error: "+ e);
        }
        return conexion;
    }
    
    
    
    public void imprimir (){
        System.out.println("imprimir");
    }
}
